


<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<% //try{
	//String employee=(request.getSession().getAttribute("empLst")).toString();
	//List<Flight> lstFlights = Arrays.asList(employee);
//}catch(Exception ex){System.out.println("......."+ ex.toString());}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Search Employee</title>
</head>
<body>

<form  method="post" action="searchEmployee.do">
<Center>Employee</Center><br/>
Please fill any of the field(s) below to search employee.
<br/>
<p>

<%
if(request.getAttribute("error")!= null){%>

Please select at least any one attribute for search

<%}
request.setAttribute("error", null);
%>

</p>
<table align="center">
<tr>
	<td>First Name: </td>
	<td><input type="text" name="fname" id="fname" ></td>
</tr>
<tr>
	<td>Last Name: </td>
	<td><input type="text" name="lname" id="lname" ></td>
</tr>
<tr>
	<td>Role: </td>
	<td><input type="text" name="role" id="role" ></td>
</tr>
<tr>
	<td>Position: </td>
	<td><input type="text" name="pos" id="pos" ></td>
</tr>
<tr>
	<td>Work description: </td>
	<td><input type="text" name="desc" id="desc" ></td>
</tr>
</table>
<table align="center">
<tr>
		<td><input type="submit" name="search" value="Search" id="search"></td>
</tr>
</table>
<center>Search result</center>
<table border=1>
	<tr>
		<th>First Name</th>
		<th>Last Name</th>
		<th>Address Line1</th>
		<th>Address Line2</th>
		<th>City</th>
		<th>State</th>
		<th>Position</th>
		<th>Role</th>
		<th>Work Description</th>
	</tr>
			<c:if test="${not empty empLst}">
			<c:set var="i" value="1"/>
			<c:forEach items="${empLst}" var="item">
			<tr>
				
				<td><c:out value="${item.firstName}" /></td>
				<td><c:out value="${item.lastName}" /></td>
				<td><c:out value="${item.addressLine1}"></c:out></td>
				<td><c:out value="${item.addressLine2}" /></td>
				<td><c:out value="${item.city}" /></td>
				<td><c:out value="${item.state}" /></td>
				
				<td><c:out value="${item.position}"></c:out></td>
				<td><c:out value="${item.role}" /></td>
				<td><c:out value="${item.workDescription}" /></td>
								
				<c:set var="i" value="${i+1}"/>
			</tr>
			</c:forEach>
		</c:if>
</table>
</form>
</body>
</html>

